package com.neu.admin;

import java.util.List;

import org.apache.commons.logging.Log;

import org.apache.commons.logging.LogFactory;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.neu.common.RequiresPermissionsDesc;
import com.neu.doc.AdminAdController_list;
import com.neu.doc.AdminAddressController_list;
import com.neu.domain.ShoppingAddress;
import com.neu.domain.ShoppingAddressExample;
import com.neu.service.ShoppingAddressService;
import com.neu.util.ResponseUtil;

import io.swagger.annotations.ApiOperation;

@RestController
@Validated
@RequestMapping("/admin/address")
public class AdminAddressController {

    private final Log logger = LogFactory.getLog(AdminAddressController.class);

    @Autowired
    private ShoppingAddressService shoppingAddressService;

    @ApiOperation(value="获取用户收货地址(List)分页数据", notes="分页查询用户收货地址",response = AdminAddressController_list.class)
    @RequiresPermissions("admin:address:list")
    @RequiresPermissionsDesc(menu = {"用户管理", "收货地址"}, button = "查询")
    @GetMapping("/list")
    public Object list(ShoppingAddressExample example) {
        List<ShoppingAddress> addresslist=shoppingAddressService.querySelective(example);
        return ResponseUtil.okList(addresslist);
    }


}
